﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the GNU General Public License version 2 (GPLv2).
// See accompanying file License.txt or copy at http://phuse.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Phuse.Net.Forums
{
    using System;

    internal partial class SendReceiveHelper<TConnection> where TConnection : Connection
    {
        private sealed class ConnectContext : OperationContext
        {
            internal ConnectContext(SendReceiveContext context, IProgress<ISendReceiveProgress> progress) :
                base(context, progress)
            {
            }

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////

            protected sealed override long ItemOffset
            {
                get { return 0; }
            }

            protected sealed override long ItemCount
            {
                get { return 1; }
            }

            protected sealed override ISendReceiveProgress CreateProgress(int percent)
            {
                return new ConnectProgress(percent, this.Group.Host.Name);
            }
        }
    }
}
